package shopping.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import shopping.dao.IRoleDao;
import shopping.entity.Role;
import shopping.service.interfaces.IRoleService;

@Service("roleServiceImpl")
public class RoleServiceImpl implements IRoleService{

	@Resource
	private IRoleDao roleDao;
	
	@Override
	public void save(Role role) {
		roleDao.save(role);
	}

	@Override
	public void deleteById(Role role) {
		roleDao.deleteById(role);
	}

	@Override
	public void update(Role role) {
		roleDao.update(role);
	}

	@Override
	public Role queryById( int roleId) {
		
		return roleDao.queryById(Role.class, roleId);
	}

	@Override
	public List<Role> findByHql(Class<Role> cla, Map<String, Object> map) {
		return roleDao.findByHql(cla, map);
	}

	@Override
	public List<Role> findByHqlPage(Map<String, Object> columsAndValues,int offset, int pageSize) {
		return roleDao.findByHqlPage(Role.class, columsAndValues, offset, pageSize);
	}

	@Override
	public int countByHql(Map<String, Object> columsAndValues) {
		return roleDao.countByHql(Role.class, columsAndValues);
	}

}
